/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  4.x                                   |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    object      controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

application     simpleFoam;

startFrom       startTime;

startTime       0;

stopAt          endTime;

endTime         1000;

deltaT          1;

writeControl    runTime;

writeInterval   10;

purgeWrite      0;

writeFormat     ascii;

writePrecision  8;

writeCompression off;

timeFormat      general;

timePrecision   6;

runTimeModifiable true;

// ************************************************************************* //

functions
{

///////////////////////////////////////////////////////////////////////////

minmaxdomain
{
    type fieldMinMax;

    functionObjectLibs ("libfieldFunctionObjects.so");

    enabled true; //true or false

    mode component;

    writeControl timeStep;
    writeInterval 1;

    log true;

    fields (p U);
}

///////////////////////////////////////////////////////////////////////////

///////////////////////////////////////////////////////////////////////////
inMassFlow
{
    type            surfaceFieldValue;
    functionObjectLibs ("libfieldFunctionObjects.so");
    enabled         true;

    //writeControl     outputTime;
    writeControl   timeStep;
    writeInterval  1;

    log             true;

    writeFields     false;

    regionType          patch;
    name      inlet;

    operation       sum;

    fields
    (
        phi
    );
}
///////////////////////////////////////////////////////////////////////////

///////////////////////////////////////////////////////////////////////////
outMassFlow
{
    type            surfaceFieldValue;
    functionObjectLibs ("libfieldFunctionObjects.so");
    enabled         true;

    //writeControl     outputTime;
    writeControl   timeStep;
    writeInterval  1;

    log             true;

    writeFields     false;

    regionType          patch;
    name      outlet;

    operation       sum;

    fields
    (
        phi
    );
}
///////////////////////////////////////////////////////////////////////////

///////////////////////////////////////////////////////////////////////////

inPre
{
    type            surfaceFieldValue;
    functionObjectLibs ("libfieldFunctionObjects.so");
    enabled         true;

    //writeControl     outputTime;
    writeControl   timeStep;
    writeInterval  1;

    log             true;

    writeFields     false;

    regionType          patch;
    name      inlet;

    operation       weightedAverage;

    fields
    (
        phi
        U
	p
    );
}

/*
CoV
areaAverage
areaIntegrate
areaNormalAverage
areaNormalIntegrate
average
max
min
none
sum
sumDirection
sumDirectionBalance
sumMag
weightedAreaAverage
weightedAverage
*/

///////////////////////////////////////////////////////////////////////////

///////////////////////////////////////////////////////////////////////////

outMax
{
    type            surfaceFieldValue;
    functionObjectLibs ("libfieldFunctionObjects.so");
    enabled         true;

    //writeControl     outputTime;
    writeControl   timeStep;
    writeInterval  1;

    log             true;

    writeFields     false;

    regionType          patch;
    name      outlet;

    operation       max;

    fields
    (
        U
	p
    );
}

///////////////////////////////////////////////////////////////////////////

};
